<!DOCTYPE html>
<html>
<head>
    <title>Formatted JSON Display</title>
    <style>
        pre {
            white-space: pre-wrap;
            word-wrap: break-word;
        }
    </style>
</head>
<body>
<pre id="jsonOutput"></pre>

<script>
    // 假设后端返回的 JSON 数据
    var backendJson = {
        "name": "John",
        "age": 25,
        "city": "New York"
    };

    var formattedJson = JSON.stringify(backendJson, null, 4);

    // 在 <pre> 标签中显示格式化后的 JSON 数据
    document.getElementById("jsonOutput").textContent = formattedJson;
</script>
</body>
</html>